package stream;

import java.util.stream.Collectors;
import java.util.stream.IntStream;

/**
 * Created by duan lian on 2018-01-29.
 */
public class CollectToMap {
	public static void main(String[] args) {
		System.out.println(IntStream.range(0, 10)
				.boxed()
				// {NPE}
				.collect(Collectors.toMap(n -> n, n -> n % 2 == 0 ? n : null)));
	}
}
